package ltd.dujiabao.activemq.broker;

import org.apache.activemq.broker.BrokerService;
import org.apache.activemq.broker.TransportConnector;

/**
 * @author : DuJiabao
 * @Project : active-mq
 * @Time : 2021/5/5 0:18
 * @Desc :
 */
public class EmbedBroker {
  public static void main(String[] args) throws Exception {
    BrokerService brokerService = new BrokerService();  // 创建一个broker服务
    brokerService.setPopulateJMSXUserID(true);
    brokerService.addConnector("tcp://127.0.0.1:61616"); // 设置ip和端口号
    brokerService.start();
  }
}
